﻿namespace PQBlog{
    class WinMgr
    {
        public Login login;
        public Form1 main;
        public Install install;
        public AddDiary addDiary;
        public DiaryView diaryView;
        static public WinMgr self = new WinMgr();
        public WinMgr()
        {
        }
        public void showLogin()
        {
            if (login==null || login.IsDisposed) login = new Login();
            login.TopMost = true;
            login.Show();
            login.TopMost = false;
        }
        public void showInstall()
        {
            if (install == null || install.IsDisposed) install = new Install();
            install.TopMost = true;
            install.Show();
            install.TopMost = false;
        }
        public void showMain()
        {
            if (main == null || main.IsDisposed) main = new Form1();
            main.TopMost = true;
            main.Show();
            main.TopMost = false;
        }
        public void showAddDiary()
        {
            if (addDiary == null || addDiary.IsDisposed) addDiary = new AddDiary();
            addDiary.TopMost = true;
            addDiary.Show();
            addDiary.TopMost = false;
        }
        public void showDiaryView()
        {
            if (diaryView == null || diaryView.IsDisposed) diaryView = new DiaryView();
            diaryView.TopMost = true;
            diaryView.Show();
            diaryView.TopMost = false;
        }
        public void quit()
        {
            main.Dispose();
            main.Close();
        }
    }
}
